import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 获取设置列表
export function getSettingList(params) {
  return request({
    url: '/admin/setting/list',
    method: 'get',
    params
  });
}

// 新增设置列表
export function addSetting(data) {
  return request({
    url: '/admin/setting/add',
    method: 'post',
    data
  });
}

// 编辑设置列表
export function editSetting(data) {
  return request({
    url: '/admin/setting/edit',
    method: 'put',
    data
  });
}

// 编辑设置列表
export function deleteSetting(data) {
  return request({
    url: '/admin/setting/delete',
    method: 'delete',
    data
  });
}
// 排序
export function settingSort(data) {
  return request({
    url: '/admin/setting/sort',
    method: 'put',
    data
  });
}

export function settingOrderSort(data) {
  return request({
    url: '/admin/setting/order/platform/sort',
    method: 'put',
    data
  });
}

// 收入类型排序
export function incomeTypeSort(data) {
  return request({
    url: '/admin/setting/order/incomeType/sort',
    method: 'put',
    data
  });
}

// 我方抬头排序
export function ourTitleSort(data) {
  return request({
    url: '/admin/setting/ourTitle/sort',
    method: 'put',
    data
  });
}

export function sortPlatFormSetting(data) {
  return request({
    url: '/admin/platformField/setting/sort',
    method: 'put',
    data
  });
}

// 下单形式排序
export function orderFormSort(data) {
  return request({
    url: '/admin/setting/order/orderForm/sort',
    method: 'put',
    data
  });
}

// 品牌标签排序
export function demandTypeSort(data) {
  return request({
    url: '/admin/setting/order/demandType/sort',
    method: 'put',
    data
  });
}

export function queryTagReference(id) {
  return request({
    url: `/admin/setting/global/tagReference/${id}`,
    method: 'get'
  });
}

export function getNotifyUsers() {
  return request({
    url: '/admin/setting/mengli/notifyUsers/list',
    method: 'get'
  });
}

export function storeNotifyUsers(data) {
  return request({
    url: '/admin/setting/mengli/notifyUsers/store',
    method: 'put',
    data
  });
}

export function getPrintProcess(params) {
  return request({
    url: 'admin/processManagement/printInfo',
    method: 'get',
    params
  });
}
// 获取-快捷筛选条件
export function getFilterData(params) {
  return request({
    url: '/admin/setting/filter/data',
    method: 'get',
    params
  });
}
// 设置-快捷筛选条件
export function setFilterData(data) {
  return request({
    url: '/admin/setting/filter/edit',
    method: 'post',
    data
  });
}

// 通用设置-客户等级排序
export function customerLevelSort(data) {
  return request({
    url: '/admin/setting/customerLevel/sort',
    method: 'put',
    data
  });
}

// 外采额度配置
export function getExternalHarvestList(params) {
  return request({
    url: '/admin/setting/externalHarvest/list',
    method: 'get',
    params
  });
}
// 通用设置-外采额度配置编辑
export function editExternalHarvest(data) {
  return request({
    url: '/admin/setting/externalHarvest/edit',
    method: 'put',
    data
  });
}
// 通用设置-外采额度配置编辑
export function createExternalHarvest(data) {
  return request({
    url: '/admin/setting/externalHarvest/create',
    method: 'post',
    data
  });
}

// 通用设置-外采额度配置编辑
export function deleteExternalHarvest(data) {
  return request({
    url: '/admin/setting/externalHarvest/delete/' + data.id,
    method: 'delete'
  });
}

export function createSecretLog(data) {
  return request({
    url: '/admin/secret/log',
    method: 'post',
    data
  });
}

// 通用设置-获取精力类型
export function getEnergyTypeList(params) {
  return request({
    url: '/admin/setting/energyTypeList',
    method: 'get',
    params
  });
}
// 通用设置-删除精力类型
export function deleteEnergyType(data) {
  return request({
    url: '/admin/setting/energyType/delete/' + data.id,
    method: 'delete'
  });
}
// 通用设置-编辑精力类型
export function editEnergyType(data) {
  return request({
    url: '/admin/setting/energyType/edit',
    method: 'put',
    data
  });
}
// 通用设置-新建精力类型
export function createEnergyType(data) {
  return request({
    url: '/admin/setting/energyType/create',
    method: 'post',
    data
  });
}
// 通用设置-获取项目类型
export function getProjectTypeList(params) {
  return request({
    url: '/admin/setting/projectTypeList',
    method: 'get',
    params
  });
}
// 通用设置-删除项目类型
export function deleteProjectType(data) {
  return request({
    url: '/admin/setting/projectType/delete/' + data.id,
    method: 'delete'
  });
}
// 通用设置-编辑项目类型
export function editProjectType(data) {
  return request({
    url: '/admin/setting/projectType/edit',
    method: 'put',
    data
  });
}
// 通用设置-新建项目类型
export function createProjectType(data) {
  return request({
    url: '/admin/setting/projectType/create',
    method: 'post',
    data
  });
}
export function createSystemLog(data) {
  return request({
    url: '/admin/sys/log',
    method: 'post',
    data
  });
}
// 通用设置-敏感词库
export function getSensitiveWord() {
  return request({
    url: '/admin/setting/sensitiveWord',
    method: 'get'
  });
}
export function setSensitiveWord(data) {
  return request({
    url: '/admin/setting/sensitiveWord/edit',
    method: 'post',
    data
  });
}

export function createUnpublished(data) {
  return request({
    url: '/admin/setting/unpublished/add',
    method: 'post',
    data
  });
}
export function editUnpublished(id, data) {
  return request({
    url: `/admin/setting/unpublished/edit/${id}`,
    method: 'put',
    data
  });
}
export function delUnpublished(id) {
  return request({
    url: `/admin/setting/unpublished/delete/${id}`,
    method: 'delete'
  });
}
export function getUnpublished(params) {
  return request({
    url: '/admin/setting/unpublished/list',
    method: 'get',
    params
  });
}
export function getTagList(params) {
  return request({
    url: '/admin/tag/list',
    method: 'get',
    params
  });
}

// 新建银行，参数同/admin/setting/add
export function createBank(data) {
  return request({
    url: '/admin/setting/businessFormAdd',
    method: 'post',
    data
  });
}
